package com.sf.dlb.jpa.repository;

import com.sf.dlb.jpa.model.AppVersionInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * APP版本管理表 Repository
 *
 * Created by jing.tan on 2018/5/21.
 */
@Repository
public interface AppVersionRepository extends JpaRepository<AppVersionInfo, Long> {
    /**
     * 根据查询-系统类型
     * @param systemType
     * @param delflag
     * @return
     */
    @Query(value = "select * from app_version a where a.system_type=?1 and a.del_flag=?2 order by a.create_date desc",nativeQuery =true)
    List<AppVersionInfo> findBySystemTypeAndDelFlag(String systemType, String delflag);
    /**
     * 根据id查询
     * @param id
     * @return
     */
    AppVersionInfo findById(Long id);
}